package com.wwg.market.ui.member.client;

import com.mobileares.midp.widgets.client.page.ItemModel;
import com.mobileares.midp.widgets.client.page.MenuBuilder;
import com.mobileares.midp.widgets.client.page.MenuModel;
import com.mobileares.midp.widgets.client.page.PageModel;
import com.nexustar.gwt.widgets.client.asyn.LoadingAsyncCallback;
import com.wwfish.gwt.model.client.ILoadModelProvider;
import com.wwfish.gwt.model.client.IModelCallback;
import com.wwfish.gwt.model.client.impl.FishModelManager;
import com.wwg.market.ui.dashboard.client.Utils;
import com.wwg.market.ui.service.interfaces.MemberService;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * 会员管理
 *
 * @author gaoyang
 * @version $Id: $
 * @date 12-2-22 上午12:03
 */
public class MenuImpl implements MenuBuilder {
    public List<MenuModel> getMenu() {
        List<MenuModel> result = new ArrayList<MenuModel>();
        MenuModel menu = new MenuModel("会员管理", MenuImpl.class.getName());
        menu.setPages(getPageModels(menu));

        result.add(menu);
        menu.addCacheCallBack(new ItemModel.CacheDateCallBack() {
            public void process() {
                //todo
            }
        });
        initModel();

        return result;
    }

    private List getPageModels(MenuModel menu) {
        List pages = new ArrayList();
        PageModel infoManagePage = new PageModel();
        infoManagePage.setMenuModel(menu);
        infoManagePage.setPageId(MemberInfoManagePage.class.getName());
        infoManagePage.setPageTitle("会员信息管理");

        PageModel levelManagePage = new PageModel();
        levelManagePage.setMenuModel(menu);
        levelManagePage.setPageId(MemberLevelManagePage.class.getName());
        levelManagePage.setPageTitle("会员等级管理");

        pages.add(infoManagePage);
        pages.add(levelManagePage);
        return pages;
    }

    private void initModel() {
    }

}
